<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'app',
  mounted() {
    window.addEventListener("beforeunload",()=>{
        localStorage.setItem("name",this.name)
    })
  },
  destroyed() {
    window.removeEventListener("beforeunload")
  },
  computed: {
    ...mapState({
      name: 'name'
    })
  }
}
</script>

<style>

</style>
